home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / sgml / msdos / sgmls08 / sgmls.doc < prev    next >
Encoding:
Text File  |  1992-05-11  |  21.1 KB  |  595 lines

  1.  
  2.  
  3.  
  4. SGMLS(1)                                                 SGMLS(1)
  5.  
  6.  
  7. NAME
  8.        sgmls - a validating SGML parser
  9.  
  10.        An SGML System Conforming to
  11.        International Standard ISO 8879 --
  12.        Standard Generalized Markup Language
  13.  
  14. SYNOPSIS
  15.        sgmls [ -acdeglrsuv ] [ -ffile ] [ -iname ] filename...
  16.  
  17. DESCRIPTION
  18.        Sgmls  parses  and  validates  the SGML document entity in
  19.        filename...  and prints on the standard  output  a  simple
  20.        ASCII  representation of its Element Structure Information
  21.        Set.  (This is the  information  set  which  a  structure-
  22.        controlled conforming SGML application should act upon.)
  23.  
  24.        The following options are available:
  25.  
  26.        -a     Detect and report ambiguous content models.
  27.  
  28.        -c     Describe capacity usage at the end of the parse.
  29.  
  30.        -d     Warn about duplicate entity declarations.
  31.  
  32.        -e     Describe  open  entities  in error messages.  Error
  33.               messages always include the position  of  the  most
  34.               recently opened external entity.
  35.  
  36.        -ffile Redirect errors to file.
  37.  
  38.        -g     Show the GIs of open elements in error messages.
  39.  
  40.        -iname Pretend that
  41.  
  42.                      <!ENTITY % name INCLUDE>
  43.  
  44.               occurs  at  the start of the document type declara-
  45.               tion subset in the  SGML  document  entity.   Since
  46.               repeated definitions of an entity are ignored, this
  47.               definition will take precedence over any other def-
  48.               initions of this entity in the document type decla-
  49.               ration.  Multiple -i options are allowed.   If  the
  50.               SGML declaration replaces the reserved name INCLUDE
  51.               then the new reserved name will be the  replacement
  52.               text  of  the  entity.  Typically the document type
  53.               declaration will contain
  54.  
  55.                      <!ENTITY % name IGNORE>
  56.  
  57.               and will use %name; in the status keyword  specifi-
  58.               cation  of  a  marked section declaration.  In this
  59.               case the effect of the option will be to cause  the
  60.               marked section not to be ignored.
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SGMLS(1)                                                 SGMLS(1)
  71.  
  72.  
  73.        -l     Output  L  commands  giving the current line number
  74.               and filename.
  75.  
  76.        -p     Parse only the prolog.  Sgmls will exit after pars-
  77.               ing the document type declaration.  Implies -s.
  78.  
  79.        -r     Warn about defaulted references.
  80.  
  81.        -s     Suppress  output.   Error  messages  will  still be
  82.               printed.
  83.  
  84.        -u     Warn about undefined element: elements used in  the
  85.               DTD but not defined.
  86.  
  87.        -v     Print the version number.
  88.  
  89.    Entity Manager
  90.        An  external  entity  resides  in  one or more files.  The
  91.        entity manager component of sgmls maps a sequence of files
  92.        into an entity in three sequential stages:
  93.  
  94.        1.     each  carriage  return  character  is turned into a
  95.               non-SGML character;
  96.  
  97.        2.     each newline character is turned into a record  end
  98.               character,  and  at  the  same  time a record start
  99.               character is inserted  at  the  beginning  of  each
  100.               line;
  101.  
  102.        3.     the files are concatenated.
  103.  
  104.        A  system identifier is interpreted as a list of filenames
  105.        separated by semi-colons.  If no system identifier is sup-
  106.        plied,  then the entity manager will attempt to generate a
  107.        filename using the public identifier (if there is one) and
  108.        other  information  available to it.  Notation identifiers
  109.        are not subject to this treatment.  This process  is  con-
  110.        trolled  by  the environment variable SGML_PATH; this con-
  111.        tains a semicolon-separated list of filename templates.  A
  112.        filename template is a filename that may contain substitu-
  113.        tion fields; a substitution field is a  %  character  fol-
  114.        lowed  by  a single letter that indicates the value of the
  115.        substitution.  If SGML_PATH uses the %S field  (the  value
  116.        of  which  is the system identifier), then the entity man-
  117.        ager will also use SGML_PATH to generate a filename when a
  118.        system identifier that does not contain any semi-colons is
  119.        supplied.  The value of a substitution  can  either  be  a
  120.        string  or  it can be null.  The entity manager transforms
  121.        the list of filename templates into a list of filenames by
  122.        substituting  for  each  substitution field and discarding
  123.        any template that contained  a  substitution  field  whose
  124.        value was null.  It then uses the first resulting filename
  125.        that exists and  is  readable.   Substitution  values  are
  126.        transformed  before  being used for substitution: firstly,
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SGMLS(1)                                                 SGMLS(1)
  137.  
  138.  
  139.        any names that were subject to upper case substitution are
  140.        folded  to  lower  case;  secondly, the characters +,./:=?
  141.        and space characters are deleted.  The  value  of  the  %S
  142.        field  is  not  transformed.   The  values of substitution
  143.        fields are as follows:
  144.  
  145.        %%     A single %.
  146.  
  147.        %D     The entity's data content notation.  This substitu-
  148.               tion  will succeed only for external data entities.
  149.  
  150.        %N     The entity, notation or document type name.
  151.  
  152.        %P     The public identifier if there was a public identi-
  153.               fier, otherwise null.
  154.  
  155.        %S     The system identifier if there was a system identi-
  156.               fier otherwise null.
  157.  
  158.        %X     (This is provided  mainly  for  compatibility  with
  159.               ARCSGML.)  A three-letter string chosen as follows:
  160.                                          |            |
  161.                                          |            |  With public identifier
  162.                                          |            +-------------+-----------
  163.                                          |  No public |    Device   |   Device
  164.                                          | identifier | independent | dependent
  165.               ---------------------------+------------+-------------+-----------
  166.               Data or subdocument entity | nsd        | pns         | vns
  167.               General SGML text entity   | gml        | pge         | vge
  168.               Parameter entity           | spe        | ppe         | vpe
  169.               Document type definition   | dtd        | pdt         | vdt
  170.               Link process definition    | lpd        | plp         | vlp
  171.  
  172.               The device dependent version  is  selected  if  the
  173.               public text class allows a public text display ver-
  174.               sion but no public text display version was  speci-
  175.               fied.
  176.  
  177.        %Y     The  type  of thing for which the filename is being
  178.               generated:
  179.               SGML subdocument entity    sgml
  180.               Data entity                data
  181.               General text entity        text
  182.               Parameter entity           parm
  183.               Document type definition   dtd
  184.               Link process definition    lpd
  185.  
  186.        The value of the following  substitution  fields  will  be
  187.        null unless a valid formal public identifier was supplied.
  188.  
  189.        %A     Null if the text identifier in  the  formal  public
  190.               identifier  contains an unavailable text indicator,
  191.               otherwise the empty string.
  192.  
  193.  
  194.  
  195.  
  196.                                                                 3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SGMLS(1)                                                 SGMLS(1)
  203.  
  204.  
  205.        %C     The public text class, mapped to lower case.
  206.  
  207.        %E     The  public  text  designating   sequence   (escape
  208.               sequence) if the public text class is CHARSET, oth-
  209.               erwise null.
  210.  
  211.        %I     The empty string if the  owner  identifier  in  the
  212.               formal  public  identifier  is an ISO owner identi-
  213.               fier, otherwise null.
  214.  
  215.        %L     The public text language,  mapped  to  lower  case,
  216.               unless  the  public text class is CHARSET, in which
  217.               case null.
  218.  
  219.        %O     The owner identifier (with the +//  or  -//  prefix
  220.               stripped.)
  221.  
  222.        %R     The  empty  string  if  the owner identifier in the
  223.               formal public  identifier  is  a  registered  owner
  224.               identifier, otherwise null.
  225.  
  226.        %T     The public text description.
  227.  
  228.        %U     The  empty  string  if  the owner identifier in the
  229.               formal public identifier is an  unregistered  owner
  230.               identifier, otherwise null.
  231.  
  232.        %V     The public text display version.  This substitution
  233.               will be null if the  public  text  class  does  not
  234.               allow a display version or if no version was speci-
  235.               fied.  If an empty version was specified,  a  value
  236.               of default will be used.
  237.  
  238.    System declaration
  239.        The system declaration for sgmls is as follows:
  240.  
  241.                            SYSTEM "ISO 8879-1986"
  242.                                   CHARSET
  243.        BASESET  "ISO 646-1983//CHARSET
  244.                  International Reference Version (IRV)//ESC 2/5 4/0"
  245.        DESCSET  0 128 0
  246.        CAPACITY PUBLIC  "ISO 8879-1986//CAPACITY Reference//EN"
  247.                                   FEATURES
  248.        MINIMIZE DATATAG NO  OMITTAG  YES   RANK     NO  SHORTTAG YES
  249.        LINK     SIMPLE  NO  IMPLICIT NO    EXPLICIT NO
  250.        OTHER    CONCUR  NO  SUBDOC   YES 1 FORMAL   YES
  251.        SCOPE    DOCUMENT
  252.        SYNTAX   PUBLIC  "ISO 8879-1986//SYNTAX Reference//EN"
  253.        SYNTAX   PUBLIC  "ISO 8879-1986//SYNTAX Core//EN"
  254.                                   VALIDATE
  255.                 GENERAL YES MODEL    YES   EXCLUDE  YES CAPACITY YES
  256.                 NONSGML YES SGML     YES   FORMAL   YES
  257.                                     SDIF
  258.  
  259.  
  260.  
  261.  
  262.                                                                 4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SGMLS(1)                                                 SGMLS(1)
  269.  
  270.  
  271.                 PACK    NO  UNPACK   NO
  272.  
  273.        The  memory usage of sgmls is not a function of the capac-
  274.        ity points used by a document; however, sgmls  can  handle
  275.        capacities significantly greater than the reference capac-
  276.        ity set.
  277.  
  278.        In some environments, higher values may be  supported  for
  279.        the SUBDOC parameter.
  280.  
  281.        Documents  that do not use optional features are also sup-
  282.        ported.  For example, if FORMAL NO  is  specified  in  the
  283.        SGML  declaration, public identifiers will not be required
  284.        to be valid formal public identifiers.
  285.  
  286.        Certain parts of the concrete syntax may be changed:
  287.  
  288.               The shunned character numbers can be changed.
  289.  
  290.               Uppercase substitution can be performed or not per-
  291.               formed both for entity names and for other names.
  292.  
  293.               Either  short  reference delimiters assigned by the
  294.               reference  delimiter  set  or  no  short  reference
  295.               delimiters are supported.
  296.  
  297.               The reserved names can be changed.
  298.  
  299.               The  quantity  set  can be increased within certain
  300.               limits subject to  there  being  sufficient  memory
  301.               available.  The upper limit on NAMELEN is 239.  The
  302.               upper limits on ATTCNT, ATTSPLEN, BSEQLEN,  ENTLVL,
  303.               LITLEN,  PILEN,  TAGLEN,  and  TAGLVL are more than
  304.               thity times greater than the reference limits.  The
  305.               upper limit on GRPCNT, GRPGTCNT, and GRPLVL is 253.
  306.               NORMSEP cannot be changed.   DTAGLEN  are  DTEMPLEN
  307.               irrelevant since sgmls does not support the DATATAG
  308.               feature.
  309.  
  310.        Ambiguous content models are  reported  (as  specified  by
  311.        MODEL YES) only if the -a option is given.
  312.  
  313.    SGML declaration
  314.        The  SGML declaration may be omitted, the following decla-
  315.        ration will be implied:
  316.                               <!SGML "ISO 8879-1986"
  317.                                      CHARSET
  318.        BASESET  "ISO 646-1983//CHARSET
  319.                  International Reference Version (IRV)//ESC 2/5 4/0"
  320.        DESCSET    0  9 UNUSED
  321.                   9  2  9
  322.                  11  2 UNUSED
  323.                  13  1 13
  324.  
  325.  
  326.  
  327.  
  328.                                                                 5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SGMLS(1)                                                 SGMLS(1)
  335.  
  336.  
  337.                  14 18 UNUSED
  338.                  32 95 32
  339.                 127  1 UNUSED
  340.        CAPACITY PUBLIC  "ISO 8879-1986//CAPACITY Reference//EN"
  341.        SCOPE    DOCUMENT
  342.        SYNTAX   PUBLIC  "ISO 8879-1986//SYNTAX Reference//EN"
  343.                                      FEATURES
  344.        MINIMIZE DATATAG NO OMITTAG  YES          RANK     NO  SHORTTAG YES
  345.        LINK     SIMPLE  NO IMPLICIT NO           EXPLICIT NO
  346.        OTHER    CONCUR  NO SUBDOC   YES 99999999 FORMAL   YES
  347.                                   APPINFO NONE>
  348.        with the exception that characters 128 through 254 will be
  349.        assigned  to  DATACHAR.  When exporting documents that use
  350.        characters in this range, an accurate description  of  the
  351.        upper  half  of the document character set should be added
  352.        to this declaration.   For  ISO  Latin-1,  an  appropriate
  353.        description would be:
  354.        BASESET   "ISO Registration Number 100//CHARSET
  355.                   ECMA-94 Right Part of Latin Alphabet Nr. 1//ESC 2/13 4/1"
  356.        DESCSET   128 32 UNUSED
  357.                  160 95 32
  358.                  255  1 UNUSED
  359.  
  360.    Output format
  361.        The output is a series of lines.  Lines can be arbitrarily
  362.        long.  Each line consists of an initial command  character
  363.        and  one  or more arguments.  Arguments are separated by a
  364.        single space, but when a command takes a fixed  number  of
  365.        arguments  the last argument can contain spaces.  There is
  366.        no space between the command character and the first argu-
  367.        ment.    Arguments   can   contain  the  following  escape
  368.        sequences.
  369.  
  370.        \\     A \.
  371.  
  372.        \n     A record end character.
  373.  
  374.        \|     Internal SDATA entities are bracketed by these.
  375.  
  376.        \nnn   The character whose code is nnn octal.
  377.  
  378.        \s     A space.  This is used only in filenames  or  nota-
  379.               tion  identifiers that contain a space.  (Filenames
  380.               can occur in the S, E and L commands.)
  381.  
  382.        The possible command characters and arguments are as  fol-
  383.        lows:
  384.  
  385.        (gi    The start of an element whose generic identifier is
  386.               gi.  Any attributes for this element will have been
  387.               specified with A commands.
  388.  
  389.        )gi    The  end an element whose generic identifier is gi.
  390.  
  391.  
  392.  
  393.  
  394.                                                                 6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SGMLS(1)                                                 SGMLS(1)
  401.  
  402.  
  403.        -data  Data.
  404.  
  405.        &name  A reference to an external data entity  name;  name
  406.               will have been defined using an E command.
  407.  
  408.        ?pi    A processing instruction with data pi.
  409.  
  410.        Aname val
  411.               The  next  element  to  start has an attribute name
  412.               with value val which takes  one  of  the  following
  413.               forms:
  414.  
  415.               IMPLIED
  416.                      The value of the attribute is implied.
  417.  
  418.               CDATA data
  419.                      The  attribute  is  character data.  This is
  420.                      used for attributes whose declared value  is
  421.                      CDATA.
  422.  
  423.               TOKEN token...
  424.                      The  attribute is a list of tokens.  This is
  425.                      used for attributes whose declared value  is
  426.                      a  name token group or one of NAME, NMTOKEN,
  427.                      NUTOKEN, NUMBER, NAMES,  NMTOKENS,  NUTOKENS
  428.                      or NUMBERS.
  429.  
  430.               NOTATION nname
  431.                      The attribute is a notation name; nname will
  432.                      have been defined using a N  command.   This
  433.                      is  used for attributes whose declared value
  434.                      is NOTATION.
  435.  
  436.               ENTITY name...
  437.                      The attribute is a list  of  general  entity
  438.                      names.   Each  entity  name  will  have been
  439.                      defined using an I, E or S command.  This is
  440.                      used  for attributes whose declared value is
  441.                      ENTITY or ENTITIES.
  442.  
  443.               ID id  The attribute is an id value.  This is  used
  444.                      for attributes whose declared value is ID.
  445.  
  446.               IDREF id...
  447.                      The  attribute  is  a list of id references.
  448.                      This is used for attributes  whose  declared
  449.                      value is IDREF or IDREFS.
  450.  
  451.        Dename name val
  452.               This  is  the same as the A command, except that it
  453.               specifies a data attribute for an  external  entity
  454.               named  ename.  Any D commands will come after the E
  455.               command that  defines  the  entity  to  which  they
  456.               apply,   but  before  any  &  or  A  commands  that
  457.  
  458.  
  459.  
  460.                                                                 7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SGMLS(1)                                                 SGMLS(1)
  467.  
  468.  
  469.               reference the entity.
  470.  
  471.        Nnname sysid pubid
  472.               Define a  notation  nname  associated  with  system
  473.               identifier  sysid, and public identifier pubid.  If
  474.               no system identifier was  specified,  the  notation
  475.               name will be used (after being transformed as if it
  476.               were a substitution value).  If no  public  identi-
  477.               fier was specified, pubid will be omitted.  A nota-
  478.               tion will only be defined if it is to be referenced
  479.               in an E command or in an A command for an attribute
  480.               with a declared value of NOTATION.
  481.  
  482.        Eename typ nname filename...
  483.               Define an external data  entity  named  ename  with
  484.               type  typ (CDATA, NDATA or SDATA), notation not and
  485.               a list of files filename...;  not  will  have  been
  486.               defined  using a N command.  Data attributes may be
  487.               specified for the  entity  using  D  commands.   An
  488.               external  data entity will only be defined if it is
  489.               to be referenced in a & command or in an A  command
  490.               for  an attribute whose declared value is ENTITY or
  491.               ENTITIES.
  492.  
  493.        Iename typ text
  494.               Define an internal data  entity  named  ename  with
  495.               type typ (CDATA or SDATA) and entity text text.  An
  496.               internal data entity will only be defined if it  is
  497.               referenced  in  an A command for an attribute whose
  498.               declared value is ENTITY or ENTITIES.
  499.  
  500.        Sename filename...
  501.               Define a subdocument entity with a  list  of  files
  502.               filename....   Such  an entity will only be defined
  503.               if  it  is  referenced  in  an  A  command  for  an
  504.               attribute  whose  declared value is ENTITY or ENTI-
  505.               TIES.
  506.  
  507.        {ename The start of the SGML subdocument entity ename.
  508.  
  509.        }ename The end of the SGML subdocument entity ename.
  510.  
  511.        Llineno file
  512.        Llineno
  513.               Set the current  line  number  and  filename.   The
  514.               filename  argument will be omitted if only the line
  515.               number has changed.  This will be  output  only  if
  516.               the -l option has been given.
  517.  
  518.        #text  An  APPINFO  parameter of text was specified in the
  519.               SGML declaration.  This is not strictly part of the
  520.               ESIS,  but  a  structure-controlled  application is
  521.               permitted to act on it.  No # command will be  out-
  522.               put  if  APPINFO NONE  was  specified.  A # command
  523.  
  524.  
  525.  
  526.                                                                 8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SGMLS(1)                                                 SGMLS(1)
  533.  
  534.  
  535.               will occur at most once, and may be  preceded  only
  536.               by a single L command.
  537.  
  538. BUGS
  539.        Non-SGML characters in literals are counted as two charac-
  540.        ters for the purposes of quantity  and  capacity  calcula-
  541.        tions.
  542.  
  543.        No  error  message  is  given  for character references or
  544.        marked section declarations between the end of the DTD and
  545.        the start of the document element.
  546.  
  547. SEE ALSO
  548.        The SGML Handbook, Charles F. Goldfarb
  549.        ISO  8879 (Standard Generalized Markup Language), Interna-
  550.        tional Organization for Standardization
  551.  
  552. ORIGIN
  553.        ARCSGML was written by Charles F. Goldfarb.
  554.  
  555.        Sgmls  was   derived   from   ARCSGML   by   James   Clark
  556.        (jjc@jclark.com), to whom bugs should be reported.
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                                                                 9
  593.  
  594.  
  595.